<%@ page language="java" import="com.gin.util.*" pageEncoding="UTF-8" %>
 <%@ page language="java" import="java.util.*" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="ssm" uri="http://ssm" %>
 <%@ include file="/head.jsp" %>


<script src="js/jquery.validate.js"></script>
<script>
    window.searchSelectUrl = "common.do?ac=selectUpdateSearch";
    window.selectUpdateUrl = "common.do?ac=tableAjax";
</script>
<script src="js/selectUpdate.js"></script>
<script src="js/datepicker/WdatePicker.js"></script>

<div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <span class="titles"> 添加试卷 </span>
        </div>
        <div class="panel-body">
            <form action="shijuan.do?ac=update" method="post" name="form1" id="form1">
                <!-- form 标签开始 -->

                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">试卷编号</label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control"
                                placeholder="输入试卷编号"
                                style="width: 150px"
                                readonly="readonly"
                                id="shijuanbianhao"
                                name="shijuanbianhao"
                                value="${Info.html(mmm.shijuanbianhao)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">试卷名称<span style="color: red">*</span></label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control"
                                placeholder="输入试卷名称"
                                style="width: 250px"
                                data-rule-required="true"
                                data-msg-required="请填写试卷名称"
                                id="shijuanmingcheng"
                                name="shijuanmingcheng"
                                value="${Info.html(mmm.shijuanmingcheng)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">所属科目</label>
                        <div class="col-sm-10">
                            <select class="form-control class_suoshukemu12" data-value="${Info.html(mmm.suoshukemu)}" id="suoshukemu" name="suoshukemu" style="width: 250px">
                                <ssm:sql var="select" type="select">SELECT * FROM kemu ORDER BY id desc</ssm:sql>
                                <c:forEach items="${select}" var="m">
                                    <option value="${m.id}">${m.kemumingcheng}</option>
                                </c:forEach>
                            </select>
                            <script>
                                $(".class_suoshukemu12").val($(".class_suoshukemu12").attr("data-value"));
                            </script>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">课程章节</label>
                        <div class="col-sm-10">
                            <div class="form-inline">
                                <select
                                    class="form-control"
                                    data-fields="kechengmingcheng,zhangjiemingcheng"
                                    data-value="${Info.html(mmm.kechengzhangjie)}"
                                    id="kechengzhangjie"
                                    name="kechengzhangjie"
                                    onchange="getAjaxData('kechengzhangjie',this,this.value)"
                                >
                                    <option value="">请选择课程章节</option>
                                </select>

                                <script>
                                    function kechengzhangjie_select_update() {
                                        var keyword = $("#kechengzhangjie_keyword").val();
                                        var where = {};
                                        searchSelect("kechengzhangjie", "kechengzhangjie", keyword, where, "kechengmingcheng,zhangjiemingcheng".split(","), "".split(","));
                                    }
                                    kechengzhangjie_select_update();
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">课程名称</label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control select-update"
                                placeholder="输入课程名称"
                                style="width: 250px"
                                id="kechengmingcheng"
                                name="kechengmingcheng"
                                value="${Info.html(mmm.kechengmingcheng)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">章节名称</label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control select-update"
                                placeholder="输入章节名称"
                                style="width: 250px"
                                id="zhangjiemingcheng"
                                name="zhangjiemingcheng"
                                value="${Info.html(mmm.zhangjiemingcheng)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">开始时间</label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control"
                                onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'zh-cn'})"
                                style="width: 200px"
                                readonly="readonly"
                                id="kaishishijian"
                                name="kaishishijian"
                                value="${Info.html(mmm.kaishishijian)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">截止时间</label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control"
                                onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'zh-cn'})"
                                style="width: 200px"
                                readonly="readonly"
                                id="jiezhishijian"
                                name="jiezhishijian"
                                value="${Info.html(mmm.jiezhishijian)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">考试时长<span style="color: red">*</span></label>
                        <div class="col-sm-10">
                            <input
                                type="number"
                                class="form-control"
                                placeholder="输入考试时长"
                                style="width: 150px"
                                data-rule-required="true"
                                data-msg-required="请填写考试时长"
                                number="true"
                                data-msg-number="输入一个有效数字"
                                id="kaoshishichang"
                                name="kaoshishichang"
                                value="${Info.html(mmm.kaoshishichang)}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">备注</label>
                        <div class="col-sm-10">
                            <textarea style="width: 80%; height: 120px" class="form-control" placeholder="输入备注" id="beizhu" name="beizhu">${Info.html(mmm.beizhu)}</textarea>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs">发布人<span style="color: red">*</span></label>
                        <div class="col-sm-10">
                            <input
                                type="text"
                                class="form-control"
                                placeholder="输入发布人"
                                style="width: 150px"
                                readonly="readonly"
                                data-rule-required="true"
                                data-msg-required="请填写发布人"
                                id="faburen"
                                name="faburen"
                                value="${mmm.faburen}"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <label style="text-align: right" class="col-sm-2 hiddex-xs"> </label>
                        <div class="col-sm-10">
                            <input name="id" value="${mmm.id}" type="hidden" />
                            <input name="referer" value="<%=request.getHeader("referer") %>" type="hidden" />
                            <input name="updtself" value="${updtself}" type="hidden" />

                            <button type="submit" class="btn btn-primary" name="Submit">提交</button>
                            <button type="reset" class="btn btn-default" name="Submit2">重置</button>
                        </div>
                    </div>
                </div>

                <!--form标签结束-->
            </form>

            <script>
                $(function () {
                    $("#form1").validate();
                });
            </script>
        </div>
    </div>
</div>

<%@ include file="/foot.jsp" %>

